Minor (but important) refactor on the add_to_path function.