Fixed Brush performance issues and memory leak. Improves brush performance