merged master into rails4; fixed specs;