Bugfixes for previous commit.