If Path optimizer is not set, create one before using it.