Fix uninitialized use of reg variable