Fixes reference bug