Fix bash variable checking