Remove unused var and fix test in NDEBUG