Add checking and error handling to IP:port processing

Fixes bug #1125430

Change-Id: I270cbfb57f74cd1ef7c4900e3dfa213f052b3931