Added --log argument to redirect log output.
Added --max-errors flag to limit number of errors/warnings printed.