#13965 #15361 cherry picks to master (for validation)