Rails4 fixes, also removing deprecation warnings. All specs passing.