Fixing problems of code