Added emptyFile check to give a better error message