Fix the bug causeing crashing.

When client entered an empty line.
Fix displaying incorrect port numbers.