Improvements to function handling.