Adding some quick changes that work around problems trying to determine the path to the input file. Mode being used (local or cluster) is also clearer this way.