-Wswitch-default and -Wuseless-cast

Fixed warnings pulled up by -Wswitch-default and -Wuseless-cast