Fixed bugs in main.js and kml servlet