Minor bug fix in test helper