Fixed crash at ctrl-z