unittests: add indirect MXFunction tester
Segfault of #653: throw error instead
Adding some assertions