fix usage of references on functions to avoid special case for void(*)()