Fix exception which occasionally caused error notifications to pop up