lib bugfixes. both examples work. haven't tested embedded yet