fix assertion - buffer-id may become NBuffers, not NBuffers - 1