Fix errors in relations controller