fix bugs in switch-ruby