Add BSON matrix import / export.
Gcc fix.
Fixes in matrix import / export.