Fix NRE when using custom boost function.