Added extra clean statement in clean_hash and clean_array to deal with objects that are emptied during cleaning