Updating the demo and fixing a few bugs in the library.