Improving robustness and adding fixtures for tests.

Closes #2