Fixed wrong ifdef syntax.
Fixed typos, added missing documentation, etc.