Fix some conditions

the -d test return true (folder exist) for a empty variable…