Fix for old Dialog function format and a stack heap collision in certain cases from a } in the wrong place