Fixed buffer offset problem.