properly support non-regular buffers