bth: bug fixes