Use rspec >= 3.0.0.
Fixed lock, tests, and error handling.