Fix a swig problem (getting Triangles) and a bug in fromarray.