Added 2 more tests and bug fixes