Use of tightdb::TableRef improved in various places
Merge pull request #676 from realm/ks-table-ref-fixes

Use of tightdb::TableRef improved in various places