A number of improvements, including better performance for determenistic functions