fixes for detached header handling

hi,
don't know why its called with the "_dev" string as argument so this may be not the root cause thats fixed here, but works now for me