Password encryption and several minor changes