fix awkward use of __len__()

simplify check and also return empty array when
there are no instances

Change-Id: I94e450e24ff91628abd3758e87ed61808583e740