Fix: handle empty files