More ref fixing