Fix bug in test generation (as introduced by earlier commit)