Fix for deadlocks
Merge pull request #647 from bhariharan/master

Fix for deadlocks
Merge branch 'master' into unstable
Merge pull request #648 from bhariharan/unstable

Merge branch 'master' into unstable