Fix last failing test cases

Typos, indexing issues, path.basename() behavior