Update AA modual to latest version.

Modify RMERGE_T fuction.
Remove duplicate code.