Fix printing to console in BSD.