converted function templates to the persistent ones (fixed crash on large wrappers)