Minor bugs in learn().