fix bad writes from drmemory