Fixed concurrency problems described here https://github.com/kesapojat/tmc-netbeans/commit/bca45fcce1862aaa019266b66c4e49388061a9bb#commitcomment-7163458