Clean up code.

Fixes #18