Improved deleteLayerPoints and added new test for deleteLayerPoints