Bug fix in buffer.hpp