Add line numbers; fix a bug