Some fixes

Fixed a few crashes.
Fixed test color in treeview color.