Fix a couple of copy pasta errors: Virtually the same code 5 times, and the last two copies did not update the set routine