Fix bug in checking hostname and passwd lenght