Misc. Cleanups

This should fix the issues in #15

It also contains other cleanups. I can remove the other cleanups if they are not desired.