Fixed issues with misuse of os.path.join