Various  fix for version 1.0.2

* fix issue #4 
* fix build warnings
* fux segfault on 32bits build