Fixed bugs with test generation