THANKS ====== Tong Sun [several patches/features]