Adding toArray header definition to return headers as an array