I think this problem has come up already. There was a bug in the library,
for which Martin posted a patch. The patch may well be in the 3.1 patchlevel
3 library, so I suggest you get that if you are not using it already. Otherwise
mail me directly and I'll fish out the patch from my mail logs.