Fix issues with rails upgrade.