Add more fixes and tests.