Fix Qt4 build issues
Minor fixes from review
Roll back failed commits automatically, and make the transaction pattern consistent