Cosmetic changes

These are just cosmetic changes + one TODO suggestion inside about simplifying the interface a bit.

I tested them by superficially glancing over the examples, everything seems to work fine in Chrome.