Fix logic errors intro ducted in refactor of app.js clustering.