Fix some rails 4 issues