Fixing GenericRepository functions