Yet another bugfix in main.js.