Formatting.
Formatting.
Fix a number of semantic errors and cleanup code.

Fixes #25.