fix some issues with cons generation