Reading an empty document returns an error