Small refactoring. Ignore path extension case.
Add tests for relative and environment paths.