Fix reads and writes of unallocated memory in analyzing patterns; suppress unused variable warning on non-debug build