Fix logging errors with HEAD requests