Check for returnCode != 0 rather than == -1.