sync from chukong:master 07-12