fix problem when defaulting a ref to a constant