Format code, and fix rspec test code