Fixed bug with the new mongodb impl.