bugs fixed. Changed serialization of matrices to make it portable across x86 and x64 platforms.