Added reference check.