table: fix lookup with incomplete bitmask