fixed memory leak + output consistency

When issuing exec() calls multiple times on the same object the memory blows up heavily because the output was appended to the array. 
Additionally this fixes consistency of the output-Variable.
Merge pull request #1 from empi89/memleakfix

fixed memory leak + output consistency