Use single mongo connection. Fix two errors.