Updated unit tests and added new ones