Tests for cipher and affine cleaned up