bug fixes for system generation