Fix unused variable in NDEBUG builds