Changed the names from table to relation for various methods and fixed resulting errors