Unit tests!

Issue #1836