Fix for MongoDB 1.8.1.

Triggers were not getting serialized correctly. This seems to fix the problem