Fixed an issue where empty headers were being passed as 'undefined'