Added case-insentive support for the 'mode' argument in both directions and distance