Mongoid fixes

Hi. Here's a little help supporting Mongoid.