Fixed bug in function module and bug in example 17, and moved new examples to paper_examples.py.