Fixed bugs in getLayerPoints and other minor bugs.