Transaction Security Improvement and Debug Fix

@rec 
@scottschurr