references and other fixes