Fixed the "PlainLogin" and cleaned up.