Fixes to SRLatch; add tests for SRLatch and Decoder.