Fix nullability of Substring expression.
Remove unnecessary white spaces.