fixes and first rspec tests