Thanks go to
 Liam Widdowson <lbw@telstra.com> for his patches.
 Markus Westergren <maw@acc.umu.se> for his patches.
 And many others.
 