Fixed an unsigned comparison
Fixed lookahead in the learner.