Fixing typo found by tests, and all tests now written.