Fix a wrapping issue in bte