Merged pull request from: https://github.com/mongodb/mongo/pull/142 Added a simple test for the pull request.