Fixes the last two test failures. I will make a PR: I think this fixes #580.