Update rails and some minor fix