Fix some bugs
upgrade to rails4.0.2