Fix for #17

I think I found the culprit for the issue I was seeing in #17. Merging my fix into develop.