Fixed color switch bug in JS.