Improve elements to generate code without errors