improved error message on too-short file