Fixes for running tests on rails 4