Fixed fogId function.