Some fix on parsing if/for/while/function in script