Update isObject() with more strict type checking.