Bugs in learn() fixed.