Fix errors in controllers and views