Fixed several buffer segfaults when multiple viewers are connected.