Fix and enhance geometry_from_string function.