Added function validator to example, updated tests.

Fixed function validator not working with objects.