more ref fixes