When you use the auxlib buffer, you have to worry about one detail. After you initialize a buffer, it keeps some intermediate results in the Lua stack...