Fixed bug in line learning method