Improved headeer detection issue #526