Fixes for mongoid 4 and ruby-2.0.0