Added tests.

Fixes #9