Implemented 3 tests, bug fixes