Fixed Access Violation bug when selecting a brush.