More changes for Rails4 upgrade