Added option to specify custom key relationships in STAT relations.