Fixes for Mongoid 4