Fix error throwing if file empty