Add Matlab compilation script and fix some small C++ errors