Fix logic to call direct cd for absolute paths from first query term to last