Fixed bitshifting for writing