fixed writing to registry on 64 bit systems