Add: minor fixings or improvements to the handling of invar type matching.