Add option to limit number of flattened nested objects