Add rspec tests, minor changes