Added os.path.normpath() to a number of places to correctly escape resource names on Windows