Fixed bug where it was possible to save a profile with invalid filename.