I already noticed a few tiny changes. these flags should be set to 1 or 0, not the bit value