Fix crashes occurring after deleting a buffer.

The issue was that deleted buffers were still left being displayed in the interface, so any attempt to delete a buffer was causing app crashing.  This switches the displayed buffer to an empty buffer upon deleting a buffer, which prevents the crashes.