private Object callMethod(Method method, String o, Object arg,
                              List<Object> initParametersProcessed) throws TemplateException {
        if (!((Class<?>) method.getDeclaringClass()).isAssignableFrom(((Class<?>) arg.getClass()))) {
            throw new TemplateException("Unable to render '\u2026:%s' at position '%s'. The function %s expects %s. It receives %s.",
                    getIdentifier(),
                    cursor.getPosition(),
                    o,
                    method.getDeclaringClass().getCanonicalName(),
                    arg.getClass().getCanonicalName());
        } else {
            if (initParametersProcessed.size() != method.getParameterTypes().length) {
                throw new TemplateException("Unable to render '\u2026:%s' at position '%s'. The function %s expects %d init-parameter(s) but receives %d init-parameter(s).",
                        getIdentifier(),
                        cursor.getPosition(),
                        o,
                        method.getParameterTypes().length,
                        initParametersProcessed.size());
            }
        }

        Exception occurred;
        try {
            return method.invoke(arg, initParametersProcessed.toArray());
        } catch (IllegalAccessException e) {
            occurred = e;
        } catch (IllegalArgumentException e) {
            occurred = e;
        } catch (InvocationTargetException e) {
            occurred = e;
        }
        for (int i = 0; i < initParametersProcessed.size(); i++) {
            Object tmpVlue = initParametersProcessed.get(i);
            if (!isAssignable(method.getParameterTypes()[i], tmpVlue.getClass())) {
                throw new TemplateException("Unable to render '\u2026:%s' at position '%s'. The function %s expects %s for parameter #%d. It receives %s.",
                        getIdentifier(),
                        cursor.getPosition(),
                        o,
                        method.getParameterTypes()[i].getCanonicalName(),
                        i + 1,
                        tmpVlue.getClass().getCanonicalName());
            }
        }

        throw new TemplateException(occurred, "Unable to determine reason.");
    }