Fix printing code