Fixed bounding_box matrix output and removed all unused imports of Matrix_generate, Matrix_listing (#2531)