I've changed the login command to force proper quoting of the password argument. I've also added some extra debugging code, which is removed when __debug__ is false.