Fixed several minor bugs in the library and fleshed out the tutorial.