Fixed output buffer error hopefully