Add inconsistency fix to main.cpp