Fix NULL pointer dereference error introduced during get_path "fixing"