minor change for var == NULL to !var etc