Clean up: mains removed, unit tests corrected