fix 'index error' splitting empty files