Add a configuration controller and bug fixes