More documentation and C99-ing