Fixed some potential concurrency issues.
Merge branch 'master' of https://github.com/mrsharpoblunto/MGDF