Fixed some basic bugs from the new code and updated examples to reflect current usage.