Cleanup of imports and fixed a resource leak in Scanner.
Merge pull request #82 from lefou/cleanup-tests

Cleanup of imports and fixed a resource leak in Scanner.