A little function to clean dirty arrays inside objects