Fix bug causing crashes when document server times out