Added a couple  of & 0xFFFF to operations involving the I register.