fix flag parser and scripts that're using it