I should have elaborated a bit more. I did try running the code against both enabled and disabled with same result. Different flags value tho.
I knew what you meant by 'Anding' the bits. Same as figuring out a subnet... I even thought about converting the number to binary and figuring out the switch values with a pencil. :)
Change that detail and it all works like a charm.