bug fixes, further testing of matrix assembly