Fix Rails issues
Merge changes