Fix syntax error, add more debugging line for pymongo bulk writer