Fixed file exist checkings