Various template fixes for rails 4 compat