External reference bug fix