Minimal changes to work with Rails4