fix a bug in computing line numbers