Adding debugging information, potential fix for some errors with addLayerForRemoval