Bugfixes to pass previous tests.