Some rails 4 fixes