Bugfixes resulting from last commit