Fix for ERT spawning.
Fix for #3432.
Merge pull request #3436 from Segrain/master

Bugfixes.