Apparently the problem was related to the version 3.2 of Octave. Now that I switched to the version 3.6 almost everything works fine, though I had to add the line:
Before calling octave_main to avoid the following error when trying to start Octave:
lex.ll:2420: void handle_number(): Assertion `nread == 1' failed.
I hope this helps to improve Octave.