Tests cleanup for rails4 branch