Fix handling failed print.