Update to Rails 4.1 and fix tests