Fix issue #1196 and some docs issues