Fix whitespace, improve error logging.