fixed bugs introduced into examples by the last commit