Fix various typos
Improve transaction handling