Fixed memory leak and unused map local URLs.
Removed unneeded code.