KML generation tested and robustified.