What I do with my students is simply underline their mistakes in a certain colour (orange lately as I found that they spot the mistakes better when it is NOT in the same colour as other remarks I might write on their papers) and jot down the corresponding code from the memo. Their job when I hand in their papers is
to read the rule in the memo and correct the mistake.
When I had reasonable-sized groups (around 25 students), I would take the papers back to have a (very) quick check and reward them with a bonus point. Now that I teach much larger groups (up to 48), I simply allot time in class to do the correction and ask them to make a list of the rules they need to work on.