Add explicit typcast to avoid Ruby 2 type error.
Merge pull request #355 from opf/feature/fix-implicit-type-cast

Add explicit type cast to avoid Ruby 2 type error.