more informative errors for check_dmat