Add trailing new line
Use a more suitable random password algorithm