Use print instead of puts when printing to stdout

In a concurrent context puts does not work as expected