Fix-GEOS-6114 (tests and minor fixes by Andrea Aime)