Fix IC debug logic to prevent crash