Fix remaining issues with PR6020