fixed errors found by splint