Fix bug where nested delegates were being treated as top level delegates.