Fixed
only ask for footer or header if the corresponding reference size is greater than zero
Merge pull request #1 from samdods/master

Fixed issue causing that causes crash (See full comment)