Update js/m2.main.js fixes #17 and #16