prefer assert(0) to exit(1)

and a few minor cleanups (compilation warnings, make check tests)