Somehow I'd managed to get my database in a pickle with stream ids. These changes were useful to debug.