GEOS-5826 simplified patch and removed regression