Fix bugs in Controller Test