adds basic tests and fixes errors discovered