Fixed typo when setting up a UDP input connection, remove debugging info, check all errors and return -1