Bugfixes all around.