Small fix and started writing test.