JTAG fixes and better test coverage