fix stack, fix getopt, fix js in dbg