Added some extra error checking; use server port number from server scan instead of hardcoded value of 32400; commented out some log lines.