Improved transaction handling.
Minor bug fixes.