Updated isAlpha and isDigit for corner cases