Fixed missing errorCode bug and wrong error code for password