Fix crash when refreshing test contents