Fixed bug in shared.clean_hdenotations