Removed duplicate safePrintMatrix