fix possible array-out-of-bounds in PUM0 calculation