Fixing the https://jira.mongodb.org/browse/PYTHON-503 bug