Fixed some bluetooth related bugs