Ported fix from SP2