Custom func tweaks

We found these changes helpful for custom_func.