A fix for displaying output correctly