Issues #83, Pull Request #122 - Updated #83 fix to use threadsafe constructs