Had a dumb logic error in the encoder logic.