Changed file and dir joining to use path.join()