Bug with empty files fixed