logError(): internal code improvements.