jpeterka_Added proper cleanup to the tests. Fixes #449