Fixes for the switch command

Could this be replaced by `FileUtils.mkdir_p(…)`? Let Ruby take care of escaping the path argument for us :-)