fixes for mongoid