Bugfixing

Closes #388 and Closes #373
Includes some minor bugfixes not worth an extra issue