Fixed kmlgen issues caused by error handling.