don't crash on empty file (fixes #5)