Bug fix in Buffer class