Fixing rspec tests and database issues