Refactoring, removed deprecated method calls
Added FailedQueryWindow (shows up when update queries fail so that the user can execute them manually)