repair command cleanup and multicase support