Added proper multifile handling