Update scan functions, typo and implement header integrity