Fix for postGIS compatibility
PostGIS compatibility patch