Fix package transformation from bson to record