fix precedence in ternary condition

previously interpreted as
 tree->ksize : (0 + ....)

causing ksize size to always be returned

Change-Id: I59a8c5de341c1149a21419223fcea4f3a54b5566