Fixing errors in clearing bits in the registers.Was using 0<<bit which is not correct