Trying to fix failed tests and bugs.