Slower but correct (wrt buffered) unbuffered version.