More Rails 4 compatibility fixes