small fixes + generate_sample renamed