Added more tests and fixed small bug with it