Fixing the printNicely function to avoid broken output on redirections/pipe