Change checks from -e to -d/-f, add check for run/1