Fixes for handling profile function calls