Fix a beginner's mistake in some switch statements, add capesDirectory.list