This should read 

else if NOT IsClass(oItem, &NumberItem)

there's no need to check IsClass against KarmaPotion again.