Further fixes and Rails 4 updates