Fix cmd_write test