fixed tests & examples as per @mdboom's comment