Get restarting to work correctly. This was one hell of a debuging experience. Stack corruption, heap corruption and a race condition all manifested itself into a slurry of cussing and abusive relationships.