Fix log and error processing bugs.