prevented empty flakes
fixed a few problems with handling of flakes
profiles are removed when a dialog is displayed