Added PRIMASK and removed "magic number". Thx to @knu.