Debugging issues in encoder