Fix fact resolution in aggregate resolver

Maybe we should move these methods to a Utils class