Improve prefix handling for console streams.