Fix filename generator
Fix bad assertion