Fixed print function