Fixed some errors & added test stubs