Fixed error in print2darray function