fix indexing of subfiles. Fixes #619