out of bounds bug fixes due to pack_coef call errors