Added dynamic tab selection in preferences dialog.