Add explicit typcast to avoid Ruby 2 type error.