backport. closes #460, #552

forgot escape backslashes