Bug fix and worked on tests.