Bugfix for primitive simulation