Clean up tracked rows in removeRow

Note: This commit also contains a fix for bug
in Tree query that blocked collection tracking