fixed uninitialized bug in pdmat