Bitmask logic was all totally wrong.

l2c bro.