updated from github.com/octave-de/serialize branch