Fixed not working tests and added a few more unit tests