Some cleanup. Main mode now renders correctly, but it's still inactive.