Removed useless deprecated dialogs
Fixed LayerVisible condition