Made transaction management a bit more transparent. Some fixes.