Fix crash when printing $(ct[*])
(cherry picked from commit aeb4e886d4cd4fde00440671f913605def9db02f)