more relaxed typeinfo, avoding problem when calling from Ruby code

Note that this is necessary, otherwise the ruby bindings report error in type mismatch