Replace fprintf(stderr, ...) with warn(...)
Simplify main()