Fixed writing over memory boundary