fixed a crash (zombie) and some compiler warnings
commit