Add possibility to set max occurence for references limit + merge references instead of ignoring it