Minor code cleanup for main.js.