Fixed a bug for loading selected view from java prefs. Minor formatting.