Prevent deadlock situation in applyChanges.
Merge pull request #12 from arvidhuss/develop

Prevent deadlock situation in applyChanges.