Creating tests and correcting some errors.