Merge "Fix overflow in path building" into nyc-dev