Compleated part to string conversion, and added a test for it in main().