Move some flags into main, instead of global scope