Upgraded to Rails 4.  Fixed several small bugs and refactored some code