Fixed flags not being set when creating header from byte array