close fd on error
Generate doc with make doc
Typos/improvements in doc
Merge pull request #1 from vbmithr/master

Mostly doc, plus close(fd) on error.