From reading the post it seems fixing the three issues mentioned would have been faster than writing all this. Honestly, if you can understand the code, those are really minor things.
(We have never tried to feed the 'fix' upstream because our fix simply hardcodes some answers. I don't think it's even possible to fix the code to do what Ubuntu apparently wants it to do, although it could be less catastrophically inefficient.)