Clean up twiddle comparison a bit and add test case for patch twiddle failure.