Hi Ben, been bitten by this myself. Looks like your analysis is correct. Attached is a debdiff with a fix.
I contacted Ryan with the proposed patch (but didn't file a SF ticket, since I lost my credentials there). Cheers, Stefan.
signature.asc
Description: PGP signature