Bugfixes for #75 and #74

Fixes #74 and #75