Hat switch bug corrected.