Added error logging to getDataFile() and extra null pointer check.