Fixed windows registry writing