Fix bugs in bluez 5 layer