fix memory error on 64 bit linux
Merge pull request #488 from matteoserva/master

fix memory error on  linux