JS general corrections and style rework.