Update to v1.0.2, including some code cleanup