Fix exception caused by removing options in variable