Avoid segfault when comparing tpr

Segfault was possible if number of idef didn't match

Change-Id: I62315e3340eec8acf14c01d14917392bc63e46e0