Fix the reference validation and close #84