Fix heredoc escape problem