Added test cases for invalid function pointers. Tidy source.