Parts of the code returned positive values for error codes, which could result in the client exiting (return value 2).