Fixing bitmasking values