Properly handling empty files (closes #8).