Torch: Fix NPE

Patchset 2: Fix code style

Change-Id: I47ecd5a85e6629ed52884d23c76f787e245c22a6
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>