This closes #103 and as discussed in that issue, hopefully fixes a common source of error discussed in #31