Bugfixes related to #37