fixed more issues for rails 4 compatibility