There's a bug in chapter 22:
label ch22s17hanasex: # ----8<---- $ hana_sex += 1 # ----8<---- if hana_sex == 0:
This check will always fail, because 'hana_sex' is set to (at least) 1 at the start of the scene.