fix build on Windows (where ssize_t must be defined)
and cleanup some compiler warnings