Fixed docs and minor code changes