Fixed some bugs in the controller.