more rails4 fixes and test coverage