Fix test and generation