Fixed problem with transaction management (script exceptions would not trigger rollback and allow partial results to be committed)