Added simplified test examples, bug fixes.