fix comparing Occurrence with object of other types