Fixed all tests and added new ones