Merge "Prevent double-applying transactions" into tm-qpr-dev