Fixed up buffer pointer bug