Fix some JS glitch with external use