Correcting bug and tests.