Fix #5769

cc @timholy