Fix: flip buffer before reading