Fixed something and added test