made BufferedStack::ApplyBuffer() safe