Fix terminate() issue

See https://github.com/Araq/Nimrod/issues/1558