Various fixes

Also, fixes #74