Bugfix for issue #389 + randomTestCreater