Maketree fix

Adds new tests for makeTree (and updated the mock to allow a working directory to be specified) and fixed a bug which I introduced in my last PR. Sorry!