small fixes in password encoding and added some tests