Fix broken type switch