Fixes

Whole bunch of fixes and tweaks. You can see the list of them in #87.