Fix BUG in fill-type dialog, code clean-up