Improve error checking and minimize output.