Remove Endo#fix; add fix utility for functions, and test that it can be used.
Merge pull request #410 from S11001001/topic/function-fix

Replace Endo#fix with a utility function