Fixed segfault on empty input file