Use of database query for copyTrans, fix sorting for tm search to use score