Sync with latest patches.
Merge pull request #15 from ginayeh/bt-master

Sync with latest patches.