<div dir="ltr">Here's a slight update which handles the default case better, as pointed out by Renato.<div><br></div><div>I'll let this sit for review a while longer, and commit tomorrow if there are no other comments.</div>
</div>