Implement clean ups.

Closes #234.