Fix compiler warnings if compiling with -DNDEBUG