Some documentation fixes, additional comments and code clean up