Added fix for keyerror on 3 or more ambiguous models + test