fix username case sensitivity, properly encode special characters in passwords