Fix for port connection status reporting and minor cleanup for comments and formatting.