[Fix #1319] Refine check for Kernel#format and Kernel#sprintf