Added some fixes suggested by cppcheck
Fixed a bug with the snapshot dialogue