Fix some clang compiler and analyzer warnings.

These are mostly checks after getting widgets from glade files.