Fixed encoding of ObjectIDs (courtesy of Mark Lubratt).