After testing with mongo cluster with aws.py settings, there are a few fixes

(cherry picked from commit 0c0b28cbc67029431bb9d15e209c9e39cbbb2c43)