Minor fix to avoid ArgumentOutOfRangeException

When the file is empty, data[0] would throw and swallow the original exception.
Merge pull request #774 from DavidS/patch-1

Minor fix to avoid ArgumentOutOfRangeException