Adding some checks for rounding errors.

Discovered that rounding errors here. I hope to implement a better fix
once I port this block to C++.
Removing test for cyclic condition.

Turns out this wasn't the issue with the decoder. The issue was found
to be related to rounding errors introduced by the encoder upstream of
this process.