Fix bug on flatten BT
fix bugs, and q54