remove deprecated gthread , fix some warnings