Fix bug with no valid geometry