[tb] merge trunk: fix bugs