fixing auto increments in sql files
added functionality to remove instances that are gone during discovery as terminated when they no longer exist