add kuhl_geometry_delete() function; improve error checking