Clear function static, then local vars before globals