Fixed Database errors and ProgressDialog not disappearing.