Fixed script errors in rspec