Fixes to make functional tests pass on MongoDB 2.4 and lower