Fixed index value check, fixed port number.

Signed-off-by: Daniel (dmilith) Dettlaff <dmilith@verknowsys.com>