Add lots of annotations and small fixes to work with splint