Fix bug around base_dir