Refine transaction2 support, rewrite SMB scripts.