Fix to reference controller missing some late references due to poor sort
Added more debug to import controller