[lab2 Exercise 3] Fix setting the sgid incorrectly.