Generator bug fixes