Fixed some bugs with Controller