Fix depreciated check

For some reason I had -a for "file exists" instead of -e. Not sure why...
Also I forgot a dollar sign.