Catch random logic bugs to prevent crashing