bugfixes to generate-names