fixed compilation issue on debian 6
fixed gcc warnings and strict-aliasing