minor fixes for compiling with NDEBUG