treat warnings as errors when building docs

also fix some warnings.