Support pathLenConstraint of 0; some related bug fixes.