more reference fixes + tests