Added some comments to make using splint easier.

Splint has alerted me to quite a few errors, I will fix these after exams.