fix output path issue & add --enable-debug support