Bugfixes for #82