Give credit to Malthe Borch for the log capture fix.