Incorrect header names merged with export options - fixes #1041, fixes #833 and fixes #964