bug fixed: changed isType() to type() (1478306)
really applied changes in 5e0f1a1 to objects without a 'length' property, and added proper tests