Fix a small bug when BT is slow to start. Add debug logging