Fixed #148 (bad line number reporting)
Some improvements due to writing documentation.