Ticket #4764: Handle template instantiations with only default parameters

Hello,

This patch properly handles template instantiations not specifying a single parameter, which fixes the ticket. Please consider merging.

Best regards,
  Simon