proper escaping of $, accompanying tests