General fixes to AppNexus protocol handling