Documentation cleanup and other code fixes