Fixed minor bugs in connecting to gmail