Actually, I think all of this is unnecessary; I removed the 'closing' logic and all of the tests still passed. I think because we defer to point-in-polygon, we can let it handle the closing for us.