Fixes runtime in train/explode()
Merge pull request #5948 from mwerezak/train

Fixes runtime in train/explode()