Minor JS style/syntax fixes in main.js
Fix JS error when global background color is removed.

See #1