improve e302 fix code

handle comments before global functions + various fixes