main() fixes