Protect for null check and Proper indentation

Line 390-391: Removing `Number` function ensures that `theNumber` variable can be `null` checked later in the `if` statement.
Line 435-437: The second `else` is under second if. Hence, Proper indentation.