Fix errors in controller