Fixes a bunch of errors related to the rails 4 switch