Fixed up main controller.