Fix rspec errors and deprecation errors