Prevent app from crashing under two rare scenarios.
refs #8006