Fixed if errors