Fixing mistakes in code