Fixed buffer access out of bounds.