Don't show the track manager in headless mode
Don't paint the contour when the viewer has a null Graphics object (probably a 3D viewer)
Fixed various NPEs