Guido provided these two patches, thanks