Added Transaction handling and other fixes