Check that getattr-ed object is a string/table/userdata before attempting to index it.