Fix issues with rails upgrade.
Merge branch 'master' into mobme_production