Fix heap corruption on 32bit systems.