Fix ambiguious and incorrect references