Fixed cleanup issue which was causing excessive lookups