Remove uneccesary forks from resolve_dir and add locals and pwd options.