Improved logging and output.