Changed Flatten return type for consistancy