Fixed some mongoose connect/disconnect bugs.