Fixes #655. Also fixes setVisible(false) for 2D controls.