Fix printing function