This is a series of two performance patches for systems that require foldmaps. The first patch fixes problem reported in issue 1286 where fspath calls cause massive performance regression. The second patch avoid using slow normpath call where it should not be necessary.