fixed bug with numpy ndarrays coming from lin_to_matrix