fix several local calls of Math.round