Simplify update_with_template() method

self.nested() was tested against None at 2 different places in the
method. It is now tested once and if it is None, the method fails
early.

Change-Id: I1296003b359b463126536f3e45c09bd2f22aa18b
Merge "Simplify update_with_template() method"