Properly escape variable in heredoc; closes #1