Cleanup:

- Fix some minor bugs
- Add more comments
- Fix example