Looks like I missed a test case, the patch I checked in based on the one in the ticket doesn't fully fix the problem.