Fix insertion of records for hmt association with scope, fix #3548