fixing errors and editing unit tests