Fixed an error and a test