Fixing normalize_function