Added checks for kpr() and debug().