#81, backport GEOS-5985