Improved stall check and logging.