Pieter's change to fix memory leak on mechanism
Merge pull request #567 from ianbarber/master

Fixed memory leak in stream engine