pull request fixes

and rails 3.2 fix