Cleanup source

Fixes #795