Fix base_dir to use os.path.join