Added Bluetooth support, relocking, and various fixes.