Fix bug in multiple files case