Fix output directory and encoding setting
Fix exit via menu