doc and code fixes