Fix selfRef generation in collections