Fixed a bug in which the removeLayers() method caused an error