Fixing strange bug with buffer interface on Linux