fix substr type check logic
Style fix
Fix LEN type check