Tidied up debug code
Fully support all apply/typeapply on const arg