fixed setting flags. +&= does not work with native ints