Are you sure you changed the temp variable to a BYTE?

By changing the temp var back to a WORD, and no other changes to my previous code.
I get the same results you do ... only writes to the first 3 bytes.