Fixed if/else if ordering