Fixed rspec tests

Changes for rspec unit tests.