fix "can't convert Fixnum into String" TypeError (issue #398)

Thanks to Guillaume Polaert for finding and reporting this.
Merge pull request #399 from aspiers/fix/398-switch-unit-TypeError

fix "can't convert Fixnum into String" TypeError (issue #398)