Fixed strange behavior in change_dir...hopefully