Flex window may be specified at command line, various cleanup