fix build and handle function types