removed unnecessary copy in expandWithVariables:
updated tests to account for change in exception being thrown in the init/new methods