Improve function validation in Func (function) class.
Add tests for Func class.