In _uc_affiliate2_handle_request() in _uc_affiliate2.module another conditional statement is required:

if (variable_get('affiliate_default_link_type', 'path') != 'query') {
  return;
}

It shouldn't go on checking the ?a for existence and potentially using its value if the admin chose the path method. If the site happens to use the ?a query for any other reason, the original code tries to interpret it and might fail.