Rails 4 compatibility & file path fix