Resolve real file path before matching

Handles index files, and simplifies a little.