fixing array.length only when array of objects

cc @ianstormtaylor for review