Fix and tests.