routine for debugging Gaussian matrices, plus some bug fixes with user-defined functions