Fix bug when checking shell variable.