Fixed bugs and implemented missing methods and accompanying unit tests