Some code cleanup. Also get rid of compile warnings
Let user know when database connection fails

This is stubbed out. Just needs an actual error message to pop up for
the user.