Fix #128 (hopefully)

This should fix all of the issues brought up in #128.