Minor fixes, and data generation