tests for function call and fixes