More ref fixes