Fixes and improvements

Several fixes and improvements. I also updated .gitignore to ignore a local gitbook installation.