Fixed failed unittests and commented other failing tests. Will need to
refactor the commented tests.