Correcting bizarre bug while removing layer