Replace fromJust in broken with case