Fix and add tests.