Bugfix/tidy

Fixes a few errors present on master at the moment.