Tidying of various tests to make them work with recent refactoring.
Merge pull request #317 from myshkin/restruct_tests

Fix tests