Removed some debugging stuff and adjusted the perm command to relog if user is determined as not logged into Sigil