Don't try to change elements that don't exist. fix #2219