read buffer macro fixes, header extraction fixes