Add tests (update issue 415)
Merge branch 'add-tests' into issue356-memory-manager