Fixed error when using the brush tool (temporary fix)