Fix error in error logging.
Allow None values.